from hytest import GSTORE
import time
from lib.button import *

def suite_setup():
    time_now = time.strftime('%Y%m%d_%H%M%S',time.localtime())
    homework_name = f'homework_{time_now}'
    GSTORE['thomework_create'].input(GSTORE['thomework_create'].loc_homework_name, homework_name)
    GSTORE['thomework_create'].select_question()
    GSTORE['iframe_homework_create'].jump()


def suite_teardown():
    GSTORE['iframe_homework_create'].click_button(button_取消)
    GSTORE['iframe_homework_create'].leave_iframe()
    GSTORE['thome'].return_home()
    GSTORE['thome'].alert_ok()
    GSTORE['thome'].open_homework_create()

